<?php


namespace App\Http\Services\Admin;


use App\Models\CoinsConfig;
use YiluTech\ComplexSearch\ComplexSearch;

class CoinsConfigService extends ComplexSearch
{
    public $root = CoinsConfig::class;

    protected $display = 'simple';
    protected $orderBy = 'id desc';

    public function detail()
    {
        return CoinsConfig::get();
    }

    public function update($data)
    {
        $result = CoinsConfig::where('param_name', $data['param_name'])->first();
        $result->param_value = $data['param_value'];
        $result->save();
        return $result;
    }

}
